package com.itheima02;

public class Student2 {
    private String name;
    private int age;
    private double hight;
    private boolean hunFou;
    private char Xingbie;

    public Student2() {
    }

    public Student2(String name, int age, double hight, boolean hunFou, char xingbie) {
        this.name = name;
        this.age = age;
        this.hight = hight;
        this.hunFou = hunFou;
        Xingbie = xingbie;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getHight() {
        return hight;
    }

    public void setHight(double hight) {
        this.hight = hight;
    }

    public boolean isHunFou() {
        return hunFou;
    }

    public void setHunFou(boolean hunFou) {
        this.hunFou = hunFou;
    }

    public char getXingbie() {
        return Xingbie;
    }

    public void setXingbie(char xingbie) {
        Xingbie = xingbie;
    }

    @Override
    public String toString() {
        return "Student2{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", hight=" + hight +
                ", hunFou=" + hunFou +
                ", Xingbie=" + Xingbie +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Student2 student2 = (Student2) o;

        if (age != student2.age) return false;
        if (Double.compare(student2.hight, hight) != 0) return false;
        if (hunFou != student2.hunFou) return false;
        if (Xingbie != student2.Xingbie) return false;
        return name != null ? name.equals(student2.name) : student2.name == null;
    }

    @Override
    public int hashCode() {
        int result;
        long temp;
        result = name != null ? name.hashCode() : 0;
        result = 31 * result + age;
        temp = Double.doubleToLongBits(hight);
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        result = 31 * result + (hunFou ? 1 : 0);
        result = 31 * result + (int) Xingbie;
        return result;
    }
}
